<extend name="./Base/base" />

<block name="main">
	<div class="page-header">
		<div class="pull-left">
			<ol class="breadcrumb visible-sm visible-md visible-lg">								
				<li><a href="index.html"><i class="icon fa fa-home"></i>Admin</a></li>
				<li class="active"><i class="fa fa-font"></i>文章列表</li>
			</ol>						
		</div>
		<!-- <div class="pull-right">
			<h2>Typography</h2>
		</div> -->					
	</div>

	<div class="row">						
		<div class="col-md-10">	
		<foreach name="list" item="vo">						
			<div class="panel bk-widget bk-border-off">
				<div class="panel-body text-left bk-bg-white bk-padding-top-15 bk-padding-bottom-15">
					<div class="row">
						<div class="col-xs-4">
							<div class="bk-avatar">
								<a href="{:U('Article/Article_list','id='.$vo['id'])}"><img src="__PUBLIC__/article/{$vo['img']}" alt="" class="img-circle bk-img-60 bk-border-info bk-border-3x"></a>	
							</div>
						</div>
						<div class="col-xs-8 text-right">
							<a href="{:U('Article/Article_list','id='.$vo['id'])}"><h4 class="bk-margin-off bk-fg-primary">{$vo['title']}</h4></a>
							<small>发布时间:{$vo['add_time']}</small>
							<div>
								<div class="btn-group">
									<a href="#" class="btn btn-info btn-xs">编号</a>
									<a href="#" class="btn btn-info btn-xs">{$vo['id']}</a>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="panel-body bk-bg-white">
					<p style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 50em;">{$vo['content']}</p>
					<div class="actions">
						<div class="btn-group">
							<if condition="$vo['iselite'] eq 0 ">
								<a href="javascript:article_iselite({$vo.id});"><i class="glyphicon glyphicon-thumbs-up" ></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<else />
								<a href="javascript:article_iselite({$vo.id});"><i class="glyphicon glyphicon-thumbs-up"  style="color:red;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							</if>	
							<a href="{:U('Article/edit','id='.$vo['id'])}"><i class="glyphicon glyphicon-pencil" style="color:#4169E1;"></i></a>&nbsp;&nbsp;&nbsp;
							<a href="javascript:article_status({$vo.id});"><i class="glyphicon glyphicon-remove" style="color:red;"></i></a>							
						</div>
						<div class="pull-right bk-fg-primary"> People liked this</div>
					</div>
				</div>
				<hr class="bk-margin-off">						
			</div>	
			</foreach>
		</div>
	</div>

</block>
<block name="script_user">
	<script type="text/javascript">
		   function article_status(id)
		   {
		   		var id = id;
		   		$.get("{:U('Article/delete')}",{id:id},function(data){
		   			if (data == 1) {
		   				window.location.reload();
		   			}else if(data == 2){
		   				alert('异常错误');
		   			};
		   			
		   		});
		   		// alert(id);
		   }

		   function article_iselite(id)
		   {
		   		var id = id;
		   		$.get("{:U('Article/choose')}",{id:id},function(data){
		   			if (data == 1) {
		   				window.location.reload();
		   			}else if(data == 2){
		   				window.location.reload();
		   			};
		   			
		   		});
		   		// alert(id);
		   }
	</script>
</block>